package com.hmall.user.web;

import com.hmall.user.pojo.Address;
import com.hmall.user.pojo.User;
import com.hmall.user.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    /**
     * 根据id查询用户
     * @param id
     * @return
     */


    @GetMapping
   public User getById(@RequestParam("id") Long id){
        User user = userService.getById(id);
        return user;
    }

    @GetMapping("/test")
    public String get(){
      return "test";
    }

    @GetMapping("/test2")
    public int gett(){
        return 2;
    }
}
